//-----------------------------------------------------------------------
// <copyright file="ObjectSub_AdessaService.cs" company="FetCo">
//     Copyright (c) FetCo. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using FetCo.Framework;
using ADESSA.Entities;
using ADESSA.Data;
    
namespace ADESSA.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class ObjectSub_AdessaService
    {
        #region ObjectSub_Adessa

        public static void CreateObjectSub_Adessa(ObjectSub_Adessa objectSub_Adessa)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                objectSub_AdessaDAO.CreateObjectSub_Adessa(objectSub_Adessa);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessCreateObjectSub_AdessaException, ex);
            }
        }        

        public static void UpdateObjectSub_Adessa(ObjectSub_Adessa objectSub_Adessa)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                objectSub_AdessaDAO.UpdateObjectSub_Adessa(objectSub_Adessa);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessUpdateObjectSub_AdessaException, ex);
            }
        }        

        public static void DeleteObjectSub_Adessa(long tag_TGKM_ObjectId)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                objectSub_AdessaDAO.DeleteObjectSub_Adessa(tag_TGKM_ObjectId);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessDeleteObjectSub_AdessaException, ex);
            }
        }
        
        public static ObjectSub_Adessa GetObjectSub_Adessa(long tag_TGKM_ObjectId)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                return objectSub_AdessaDAO.GetObjectSub_Adessa(tag_TGKM_ObjectId);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObjectSub_AdessaException, ex);
            }
        }                

        public static ObjectSub_AdessaCollection GetObjectSub_AdessaList(ObjectSub_AdessaColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                return objectSub_AdessaDAO.GetObjectSub_AdessaList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObjectSub_AdessaListException, ex);
            }
        }        

        public static ObjectSub_AdessaCollection GetObjectSub_AdessaList(ObjectSub_AdessaColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                return objectSub_AdessaDAO.GetObjectSub_AdessaList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObjectSub_AdessaListException, ex);
            }
        }        

	    public static ObjectSub_AdessaCollection GetObjectSub_AdessaListByParam(object orderBy, OrderDirection orderDirection,string where)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                return objectSub_AdessaDAO.GetObjectSub_AdessaListByParam(orderBy, orderDirection,where);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObjectSub_AdessaListException, ex);
            }
        }        

        public static ObjectSub_AdessaCollection GetObjectSub_AdessaListByParam(object orderBy, OrderDirection orderDirection, int page, int pageSize,string Criteria, out int totalRecords)
        {            
            try
            {
                ObjectSub_AdessaDAO objectSub_AdessaDAO = new ObjectSub_AdessaDAO();
                return objectSub_AdessaDAO.GetObjectSub_AdessaListByParam(orderBy, orderDirection, page, pageSize,Criteria, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SR.BusinessGetObjectSub_AdessaListException, ex);
            }
        }        

        #endregion
    }
}